package cn.jiadakeji.parent.controller;

import cn.jiadakeji.parent.common.core.controller.BaseController;
import cn.jiadakeji.parent.common.core.domain.AjaxResult;
import cn.jiadakeji.parent.common.page.PageDomain;
import cn.jiadakeji.parent.common.page.TableDataInfo;
import cn.jiadakeji.parent.dto.SchoolClassDTO;
import cn.jiadakeji.parent.dto.SchoolDTO;
import cn.jiadakeji.parent.service.SchoolClassService;
import com.alibaba.druid.sql.PagerUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Set;

/**
 * @author heyanfeng
 * @create 2022-03-09 17:10
 */
@Slf4j
@Api(value = "学校班级信息",tags = {"学校班级信息接口"})
@RestController
@RequestMapping("/schoolClass")
public class SchoolClassController extends BaseController {
    @Autowired
    private SchoolClassService classService;

    @ApiOperation("获取所有年级班级")
    @GetMapping("/gradeClass/{schoolId}")
    public TableDataInfo getSchoolGrade(
            @ApiParam("学校ID")
            @PathVariable("schoolId")String schoolId){
        startPage();
        List<SchoolClassDTO> classDTOList = classService.getSchoolGrade(schoolId);
        return getDataTable(classDTOList);
    }


}
